package cn.bdqn.service.sys.impl;

import cn.bdqn.dao.sys.SysStudentDao;
import cn.bdqn.service.sys.SysStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @ProjectName: ycbdqn
 * @Package: cn.bdqn.service.sys.impl
 * @Author: huat
 * @Date: 2020/3/11 17:56
 * @Version: 1.0
 */
@Service
public class SysStudentServiceImpl implements SysStudentService {
    @Autowired
    SysStudentDao sysStudentDao;
    /**
     * 分页查询学生
     * @param page 起始页
     * @param limit 页面大小
     * @param username  学生姓名
     * @param realName 学生真实姓名
     * @return
     */
    @Override
    public Map<String, Object> getStudent(int page, int limit, String username,String realName) {
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("count",sysStudentDao.countStudent(username, realName));
        map.put("data",sysStudentDao.getStudent((page-1)*limit, limit, username, realName));
        map.put("code",0);
        return map;
    }
}
